<?php
echo "Student list:<br>";
include('Student.php');
$students = array();


$first = new Student("Doe", "John", "Junior"); 
$first->add_email('home', 'john@doe.com');
$first->add_email('work', 'jdoe@mcdonalds.com');
$first->add_grade(65);
$first->add_grade(75);
$first->add_grade(55);
$students['j123'] = $first;


$second = new Student("Einstein", "Albert", "Freshman"); 
$second->add_email('home', 'albert@braniacs.com');
$second->add_email('work1', 'a_einstein@bcit.ca');
$second->add_email('work2', 'albert@physics.mit.edu');
$second->add_grade(95);
$second->add_grade(80);
$second->add_grade(50);
$students['a456'] = $second;


$myself = new Student("Zhong", "Jian", "Chinese"); 
$myself->add_email('home', 'Zhong@Jian.ca');
$myself->add_grade(60);
$myself->add_grade(70);
$myself->add_grade(72.5);
$students['x789'] = $myself;


$fourth = new Student("Gates", "Bill", "Junior"); 
$fourth->add_email('home', 'gates@microsoft.com'); 
$fourth->add_grade(98);
$fourth->add_grade(99);
$fourth->add_grade(98.5); 
$students['b012'] = $fourth;


ksort($students);


foreach ($students as $student) {
    echo $student->toString();
}
?>